using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class IA_AuthorizationMap : EntityTypeConfiguration<IA_Authorization>
    {
        public IA_AuthorizationMap()
        {
            // Primary Key
            this.HasKey(t => t.id);

            // Properties
            this.Property(t => t.id)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.Guarantor)
                .HasMaxLength(6);

            this.Property(t => t.Status)
                .HasMaxLength(2);

            this.Property(t => t.COV_Card)
                .HasMaxLength(20);

            // Table & Column Mappings
            this.ToTable("IA_Authorization");
            this.Property(t => t.id).HasColumnName("id");
            this.Property(t => t.procedure).HasColumnName("procedure");
            this.Property(t => t.Guarantor).HasColumnName("Guarantor");
            this.Property(t => t.ExpectedDaystoAuth).HasColumnName("ExpectedDaystoAuth");
            this.Property(t => t.Request_Date).HasColumnName("Request_Date");
            this.Property(t => t.Request_User).HasColumnName("Request_User");
            this.Property(t => t.Auth_Date).HasColumnName("Auth_Date");
            this.Property(t => t.Auth_User).HasColumnName("Auth_User");
            this.Property(t => t.Auth_Expiry).HasColumnName("Auth_Expiry");
            this.Property(t => t.Status).HasColumnName("Status");
            this.Property(t => t.COV_Class).HasColumnName("COV_Class");
            this.Property(t => t.COV_PLAN).HasColumnName("COV_PLAN");
            this.Property(t => t.COV_Contract).HasColumnName("COV_Contract");
            this.Property(t => t.COV_Card).HasColumnName("COV_Card");
            this.Property(t => t.COV_CardExpiry).HasColumnName("COV_CardExpiry");
            this.Property(t => t.Void).HasColumnName("Void");
            this.Property(t => t.Note).HasColumnName("Note");
        }
    }
}
